package com.freemalll.merchant.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.freemalll.merchant.domain.entity.MerAttachValue;
import com.freemalll.merchant.mapper.MerAttachValueMapper;
import com.freemalll.merchant.service.MerAttachValueService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 服务层实现。
 *
 * @author songshixiong
 * @since 2025-05-22
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MerAttachValueServiceImpl extends ServiceImpl<MerAttachValueMapper, MerAttachValue> implements MerAttachValueService {

    @Override
    public void insertBatch(String attachId, List<String> attachResultList) {
        for (String attachResult : attachResultList) {
            MerAttachValue merAttachValue = new MerAttachValue();
            merAttachValue.setAttachId(attachId);
            merAttachValue.setValValue(attachResult);
            baseMapper.insert(merAttachValue);
        }
    }
}
